﻿using MediatR;
using W.Purchase.API.Application.Command.ClientCommand;
using W.Purchase.Domain;
using W.Purchase.Repository.Interface;

namespace W.Purchase.API.Application.CommandHandler.ClientCommandHandler
{
    public class ContactFindCommandHandler : IRequestHandler<ContactFindCommand, Domain.Contact>
    {
        private readonly IContactRepository repository;
        public ContactFindCommandHandler(IContactRepository repository)
        {
            this.repository = repository;
        }
        public async Task<Contact> Handle(ContactFindCommand request, CancellationToken cancellationToken)
        {
            var list = await repository.GetModelAsync(request.ContactId);
            return list;
        }
    }
}
